package club.dmyang.others;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * Created by brss on 2018/8/16.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class RedisTeset {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Test
    public void testRedis(){

        Object tag_listall = stringRedisTemplate.opsForValue().get("tag_listall");
        List notice = stringRedisTemplate.opsForList().range("notice", 0, -1);

        System.out.println(tag_listall);
        System.out.println(notice.size());
        System.out.println();
    }
}